﻿using System;
using System.Text;
using System.Data;
using System.Collections.Generic;
using VIT.Web.UI;

namespace VIT.Web.Modules.Survey
{
    public partial class Survey : VITModule
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
                init();
        }

        private void init()
        {
            // khai bao cac control phuc vu cho viec thay doi ngon ngu
            try
            {
                rdbYKien.Items[0].Text = (string)GetGlobalResourceObject("Web", "ChuyenNghiep");
                rdbYKien.Items[1].Text = (string)GetGlobalResourceObject("Web", "KhaChuyenNghiep");
                rdbYKien.Items[2].Text = (string)GetGlobalResourceObject("Web", "BinhThuong");
                rdbYKien.Items[3].Text = (string)GetGlobalResourceObject("Web", "KhongChuyenNghiep");
                btnBinhChon.Text = (string)GetGlobalResourceObject("Web", "Survey");
                btnKetQua.Text = (string)GetGlobalResourceObject("Web", "KetQua");
            }
            catch { }
        }

        protected void btnBinhChon_Click(object sender, EventArgs e)
        {
            StringBuilder link = new StringBuilder();
            link.Append(this.AppRelativeTemplateSourceDirectory);
            link.Append("SurveyView.aspx?vote=");
            link.Append(rdbYKien.SelectedItem.Value);
            Response.Redirect(link.ToString());
        }

        protected void btnKetQua_Click(object sender, EventArgs e)
        {
            StringBuilder link = new StringBuilder();
            link.Append(this.AppRelativeTemplateSourceDirectory);
            link.Append("SurveyView.aspx");
            Response.Redirect(link.ToString());
        }
    }
}